import { CORRECTION_TABLE } from '../defined';

/**
 * 拼音纠错
 * @param yinJieList 音节列表
 * @returns [[原始拼音, 匹配到的拼音], ...]
 */
export const correct = (yinJieList: string[]): [string, string][] => {
  return yinJieList.map(item => [item, CORRECTION_TABLE.get(item) ?? item]);
}